package com.aglhz.nature.view;

import com.aglhz.nature.R;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.util.Log;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class IntroduceActivity extends Activity{
	private String url;
	private WebView introWeb;
	String iv1Url;
	String iv2Url;
	String iv3Url;
	String iv4Url;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.intorduce);
		introWeb=(WebView) findViewById(R.id.introWeb);
		
		Intent intent=getIntent();
		iv1Url = intent.getStringExtra("iv1");

		iv2Url = intent.getStringExtra("iv2");
		
		iv3Url = intent.getStringExtra("iv3");
		
		iv4Url = intent.getStringExtra("iv4");
		
		
		if(!(null==iv1Url)){
			url=iv1Url;
		}else if(!(null==iv2Url)){
			url=iv2Url;
		}else if(!(null==iv3Url)){
			url=iv3Url;
		}else if(!(null==iv4Url)){
			url=iv4Url;
		}else{
			
		}
		
		WebSettings webSettings = introWeb.getSettings();  
	    //设置WebView属性，能够执行Javascript脚本    
	    webSettings.setJavaScriptEnabled(true);    
	    //设置可以访问文件  
	    webSettings.setAllowFileAccess(true);  
	  //webview自适应屏幕
	    webSettings.setUseWideViewPort(true); 
	    webSettings.setLoadWithOverviewMode(true); 

	    introWeb.loadUrl(url);    
	    //设置Web视图  
	    introWeb.setWebViewClient(new WebViewClient(){
	        @Override
	        public boolean shouldOverrideUrlLoading(WebView view, String url) {
	            view.loadUrl(url);
	            return true;
	        }
	       
	        @Override
	        public void onPageStarted(WebView view, String url, Bitmap favicon) {
	        	
	        	super.onPageStarted(view, url, favicon);
	     
	        
	    	
	        }
	        
	        @Override
			public void onPageFinished(WebView view, String url) {
				
				super.onPageFinished(view, url);
				

			}
	    });
	 

	}
	
}
